<?php get_header(); ?>
<main id="works" role="main">
	<div class="items">
		<?php while(have_posts()) : the_post(); ?>
		<div class="item">
			<?php if(has_post_thumbnail()) : ?>
				<a class="thumbnail" href="<?php the_permalink(); ?>">
					<?php the_post_thumbnail(); ?>
				</a>
			<?php endif; ?>
			<div class="caption">
				<h3><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title_attribute(); ?></a></h3>
				<p><?php echo $post->post_excerpt; ?></p>
			</div>
		</div>
		<?php endwhile; ?>
	</div>
	<?php
		$post_pagination = paginate_links(array(
			'type' => 'list',
			'prev_text' => '&laquo;',
			'next_text' => '&raquo;',
		));

		if($post_pagination) {
			echo '<nav class="post-pagination" role="navigation">' . $post_pagination . '</nav>';
		}

		wp_reset_query();
	?>
</main>
<?php get_footer(); ?>